package com.lcm.learn.lcmcode.clazz;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @description:
 * @author: lcm
 * @create: 2020-01-17 14:57
 **/

public class ClassTest {

    public static void main(String[] args) throws ClassNotFoundException {
        Object o=new Object();
        Class<?> clazz = o.getClass();
        Class<?> dateClass = Date.class;
        Class<?> hashMapClass = Class.forName("java.util.HashMap");

        Field[] fields = clazz.getFields();


        ArrayList list=new ArrayList();

        System.out.println(list instanceof ArrayList);
        System.out.println(list instanceof List);
        System.out.println(List.class.isInstance(list));
        System.out.println(List.class.isAssignableFrom(ArrayList.class));
        System.out.println(ArrayList.class.isAssignableFrom(List.class));
    }

}
